package API.Collection.ImmutableCollection;

import java.util.List;

public class ListExample {
    public static void main(String[] args) {
        List<String> list = List.of("Jack", "Nick", "Black", "Mike", "Alma");
        for (String s : list) {
            System.out.print(s + " ");
        }
        // 以下的代码在执行时均回报错
        // list.add("Alic");
        // list.remove("Alma");
        // list.set(0, "Ala");
    }
}
